<?php
mysql_connect ("localhost", "root","")  or die (mysql_error());
mysql_select_db ("qexplorer");

if (!isset($_POST['term']) || empty($_POST['term']))
{
	$term = "Unesite pojam za pretragu...";
}
else
$term = addslashes($_POST['term']);
$sql = mysql_query("select * from ajeti2 where ajet like '%$term%'");

?> 
<html>
    <head>
        <title>qexplorer</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<!--
	<script type="text/javascript" src="http://lab.dotjay.co.uk/experiments/forms/input-placeholder-text/input-placeholder-text.js"></script>
	-->
	<script type="text/javascript" src="script.js"></script>
    </head>
    <body>
    <form action="<?php echo "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];?>" method="post">
	<img src="qexplorer.png" alt="" /> <br />
	<input class="auto-clear" type="text" id="text-clear" name="term" title="Unesite pojam za pretragu..." value="" size="25" /> <br />  
	<input type="submit" name="submit" value="Traži" />
    </form>
 <hr>
<?php
	while ($row = mysql_fetch_array($sql)){
		echo $row['ajet'].'<br/>';
		echo 'Sura '.$row['sura'].':'.$row['ajet_rb'];
		echo '<br/><br/>';
	}	
?>
    </body>
</html>

